home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
- *
- * $Source: /unixb/home/unixlib/source/unixlib37/src/unix/c/RCS/ispipe,v $
- * $Date: 1996/10/30 21:59:01 $
- * $Revision: 1.2 $
- * $State: Rel $
- * $Author: unixlib $
- *
- * $Log: ispipe,v $
- * Revision 1.2 1996/10/30 21:59:01 unixlib
- * Massive changes made by Nick Burret and Peter Burwood.
- *
- * Revision 1.1 1996/04/19 21:35:27 simon
- * Initial revision
- *
- ***************************************************************************/
-
- static const char rcs_id[] = "$Id: ispipe,v 1.2 1996/10/30 21:59:01 unixlib Rel $";
-
- #include <errno.h>
- #include <unistd.h>
- #include <sys/types.h>
- #include <sys/dev.h>
- #include <sys/unix.h>
-
- int
- ispipe (int fd)
- {
- register struct file *f;
-
- if (BADF (fd))
- {
- errno = EBADF;
- return (-1);
- }
-
- f = __u->file + fd;
-
- return (major (f->dev) == DEV_PIPE);
- }
-